Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix incorrect LoopContinue instruction in while-do loops #2866

Closed
wants to merge 1 commit into from

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Apr 24, 2023

While working on #2857 I discovered that while generating the bytecode for do-while loops we were emitting an orphan LoopContinue that is never executed, which was preventing the error to be thrown when max loop iteration is reached.

This can more easily be identified with it's flowgraph : (do { 1; } while(0) )

Main:

With this PR:

@HalidOdat HalidOdat added bug Something isn't working vm Issues and PRs related to the Boa Virtual Machine. labels Apr 24, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 94,593 94,593 0
Passed 73,210 73,210 0
Ignored 17,532 17,532 0
Failed 3,851 3,851 0
Panics 0 0 0
Conformance 77.39% 77.39% 0.00%

@HalidOdat HalidOdat marked this pull request as ready for review April 24, 2023 05:51
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #2866 (bca1f53) into main (63d9d67) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2866   +/-   ##
=======================================
  Coverage   50.95%   50.95%           
=======================================
  Files         419      419           
  Lines       41874    41874           
=======================================
  Hits        21335    21335           
  Misses      20539    20539           
Impacted Files Coverage Δ
boa_engine/src/bytecompiler/statement/loop.rs 81.32% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@nekevss
Copy link
Member

nekevss commented Apr 24, 2023

bors r+

bors bot pushed a commit that referenced this pull request Apr 24, 2023
While working on #2857 I discovered that while generating the bytecode for `do-while` loops we were emitting an orphan `LoopContinue` that is never executed, which was preventing the error to be thrown when max loop iteration is reached.

This can more easily be identified with it's flowgraph : (`do { 1; } while(0) `)

Main:

<details>
<img src="https://user-images.githubusercontent.com/8566042/233908011-247313bc-6435-4622-8ecb-f469d9eaf850.png">
</details>

With this PR:

<details>
<img src="https://user-images.githubusercontent.com/8566042/233908030-3552636e-f09c-4c5e-8c7c-1ecfa0024dfe.png">
</details>
@bors
Copy link

bors bot commented Apr 24, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix incorrect LoopContinue instruction in while-do loops [Merged by Bors] - Fix incorrect LoopContinue instruction in while-do loops Apr 24, 2023
@bors bors bot closed this Apr 24, 2023
@bors bors bot deleted the fix/do-while-environment branch April 24, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vm Issues and PRs related to the Boa Virtual Machine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants